<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    Array.prototype.myFilter = function(fn)
    {
        let result = [];
        for(let i = 0;i<this.length;i++)
        {
            let condition = fn.call(this,this[i],i,this);
            if(condition)
            {
                 result.push(this[i]);
            }
        }
        return result;
    }

    let arr = [1,3,5,7,9,10];
   let result = arr.myFilter((item,index,arr)=>{
        return item%2 ===0;
    });
    console.log(result);
</script>
<body>
    
</body>
</html>